package cn.rslee.demo.spring.jpa.service;

import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.data.domain.Page;

import cn.rslee.demo.spring.jpa.entity.AccessLog;
import cn.rslee.demo.spring.jpa.entity.DateParam;

/**
 * 描述：
 * 
 * <pre>
 * HISTORY
 * ****************************************************************************
 *  ID   DATE           PERSON          REASON
 *  1    2016年2月26日      rslee         Create
 * ****************************************************************************
 * </pre>
 * 
 * 
 * JPA 支持按照实体类的属性进行动态查询，基于QBE实现
 * http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.core-concepts
 * http://docs.jboss.org/hibernate/jpamodelgen/1.0/reference/en-US/html_single/#whatisit
 * 
 * 
 * @author rslee
 * @since 1.0
 */
public interface AccessLogCustomerService {
	
	
	/**
	 * 分页读取,访问格式为：/cusaccesslogs/page?page=2&size=100
	 * &sysCode=xxx&username=xxx&visitTmFrom=xxx&visitTmTo=xxx
	 * @return
	 * List<AccessLog>
	 */
	@GET
    @Path("/cusaccesslogs/page")
	@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces(MediaType.APPLICATION_JSON)
	Page<AccessLog> findByPage(@FormParam("page")  int page,@FormParam("size") int size,
			@FormParam("sysCode")  String sysCode,@FormParam("username")  String username,
			@FormParam("visitTmFrom")  DateParam visitTmFrom,@FormParam("visitTmTo")  DateParam visitTmTo);
	

}
